package com.zhb.cloud.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zhb.cloud.core.JsonReturn;
import com.zhb.cloud.sys.model.User;
import com.zhb.cloud.sys.service.UserService;

/**
 * @ClassName: UserController
 * @Description: 用户操作
 * @author: zhb zhb1316783262@163.com
 * @date: 2017年10月27日 下午4:47:30
 *
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("findByUserName")
    public JsonReturn findByUserName(String userName) {
        User user = userService.findByUserName(userName);
        JsonReturn jsonReturn = new JsonReturn();
        jsonReturn.setCode(200);
        jsonReturn.setData(user);
        jsonReturn.setMessage("查询成功");
        return jsonReturn;
    }

}
